<?php

/**
 * 语言版本
 * Created by PhpStorm.
 * User: jingshou
 * Date: 2017/8/29
 * Time: 21:03
 */

namespace app\common;

use think\Session;

class System
{
    const LANG_ZH = 'zh';
    const LANG_WAP = 'wap';
    public static $lang_list;

    public static function langList()
    {
        if (self::$lang_list === null) {
            self::$lang_list = [
                self::LANG_ZH => '中文版',
//                self::LANG_WAP => '手机版',
            ];
        }

        return self::$lang_list;
    }

    public function langMsgAttr()
    {
        $list = self::langList();
        $lang = Session::get('language');
        return !empty($list) ? $list[$lang] : null;
    }
}